if ( SERVER ) then

	AddCSLuaFile( "shared.lua" )
	
	SWEP.HoldType			= "pistol"
	
end

if ( CLIENT ) then

	SWEP.PrintName			= "Manhack"
	SWEP.Author				= "Valve"

	SWEP.Slot				= 0
	SWEP.SlotPos			= 0
	SWEP.ViewModelFOV		= 62
	SWEP.Category = "HL2 Beta Sweps"

end
---------------------------------------------------
 
-- function SWEP:Reload() --To do when reloading
-- end 
 
function SWEP:Think() -- Called every frame
end

function SWEP:Initialize()
	if( SERVER ) then
		self:SetWeaponHoldType( "pistol" );
	        self.Owner:SetAnimation( ACT_VM_IDLE )
        end
util.PrecacheSound("")
end

function SWEP:PrimaryAttack()
self.Weapon:SetNextPrimaryFire(CurTime() + 0.7)

local trace = self.Owner:GetEyeTrace()

if trace.HitPos:Distance(self.Owner:GetShootPos()) <= 85 then
		self.Owner:SetAnimation(ACT_VM_IDLE)
		self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
	bullet = {}
	bullet.Num    = 1
	bullet.Src    = self.Owner:GetShootPos()
	bullet.Dir    = self.Owner:GetAimVector()
	bullet.Spread = Vector(0, 0, 0)
	bullet.Tracer = 0
	bullet.Force  = 1
	bullet.Damage = 6
self.Owner:FireBullets(bullet) 
self.Weapon:EmitSound("npc/manhack/grind" .. math.random( 1,5 ) .. ".wav")
else
                self.Weapon:EmitSound("npc/manhack/mh_blade_snick1.wav")
		self.Owner:SetAnimation( IDLE )
                self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
end

end
 
function SWEP:Deploy()
return true;
end

function SWEP:Holster()
return true;
end

function SWEP:SecondaryAttack()
end
 
-------------------------------------------------------------------
SWEP.Author   = "Valve"
SWEP.Contact        = "n/a"
SWEP.Purpose        = "To be a manhack."
SWEP.Instructions   = "Primary=Blade"
SWEP.Spawnable      = true
SWEP.AdminSpawnable  = false
-----------------------------------------------
SWEP.ViewModel      = "models/weapons/v_Manhack.mdl"
SWEP.WorldModel   = "models/manhack.mdl"
-----------------------------------------------
SWEP.Primary.Delay		= 0.7
SWEP.Primary.Recoil		= 0
SWEP.Primary.Damage		= 6
SWEP.Primary.NumShots		= 1		
SWEP.Primary.Cone		= 0
SWEP.Primary.ClipSize		= -1
SWEP.Primary.DefaultClip	= -1
SWEP.Primary.Automatic   	= false
SWEP.Primary.Ammo         	= "none" 
-------------------------------------------------